let user = {
    name: "John",
    age: 30,
};

alert(count(user));

function count(obj) {
    let sum = 0;
    for (let key of Object.keys(obj)) {
        sum += 1;
    }
    return sum;
}